<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>今天天气很{{info}}</h2>
        <!-- 绑定事件的时候 @xxx='yyy' yyy可以写一些简单的语句 -->
        <!-- <button @click="isHot=!isHot">切换天气</button> -->
        <button @click="changeweather">切换天气</button>
    </div>
    <script>
        Vue.config.productionTip = false
        var vm = new Vue({
            el:'#app',
            data:{
                isHot:true
            },
            methods:{
                changeweather(){
                    this.isHot = !this.isHot;
                }
            },
            computed:{
                info(){
                    return this.isHot?'炎热':'凉爽'   
                }
            }
        })
        
    </script>
</body>
</html>